package com.zkingsoft.zkingbase.manager;

import android.util.Log;

/**
 * Created by ytf on 2017/3/14 014.
 * Description: log管理类
 */

public class LogManager
{
    private static LogManager instance;
    private boolean showLog;
    private static final String TAG = "s";

    private LogManager()
    {
        showLog = true;
    }

    public static LogManager getInstance()
    {
        if(instance == null)
        {
            synchronized (LogManager.class)
            {
                if(instance == null)
                {
                    instance = new LogManager();
                }
            }
        }
        return instance;
    }

    public void setDebug(boolean yn)
    {
        showLog = yn;
    }

    public void e(String msg)
    {
        if(showLog)
            Log.e(TAG, msg);
    }

    public void e(String tag, String msg)
    {
        if(showLog)
            Log.e(tag, msg);
    }

    public void d(String msg)
    {
        if(showLog)
            Log.d(TAG, msg);
    }

    public void d(String tag, String msg)
    {
        if(showLog)
            Log.d(tag, msg);
    }
    public void i(String msg)
    {
        if(showLog)
            Log.i(TAG, msg);
    }

    public void i(String tag, String msg)
    {
        if(showLog)
            Log.i(tag, msg);
    }

    public void v(String msg)
    {
        if(showLog)
            Log.v(TAG, msg);
    }

    public void v(String tag, String msg)
    {
        if(showLog)
            Log.v(tag, msg);
    }
}
